package com.zxg.zbc.domain;

import java.io.Serializable;

public class WordPair implements Serializable {

  /**
   * 
   */
  private static final long serialVersionUID = 1L;

  private String            cn;

  private String            en;

  private Long              pv;

  public WordPair(String en, String cn) {
    super();
    this.cn = cn;
    this.en = en;
  }

  public String getCn() {
    return cn;
  }

  public void setCn(String cn) {
    this.cn = cn;
  }

  public String getEn() {
    return en;
  }

  public String getEnAppend() {
    return en + " ";
  }

  public void setEn(String en) {
    this.en = en;
  }

  public String getDisplay() {
    return en + "[" + cn + "]";
  }

  @Override
  public boolean equals(Object obj) {

    if (obj instanceof String) {
      String w = (String) obj;
      return en.equals(w);
    }
    if (obj instanceof WordPair) {
      WordPair w = (WordPair) obj;
      return w.getEn().equals(en);
    }
    return false;
  }

  public Long getPv() {
    return pv;
  }

  public void setPv(Long pv) {
    this.pv = pv;
  }

  @Override
  public int hashCode() {
    return en.hashCode();
  }
}
